package com.example.lunbo;

import android.media.MediaPlayer;
import android.os.Handler;
import android.widget.ImageView;
import android.widget.VideoView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

/**
 * @ProjectName : Lunbo
 * @Author : 白月初
 * @Time : 2022/3/1 15:54
 * @Description : 描述
 */
public class RotationAdapter extends BaseMultiItemQuickAdapter<MediaDetailBean, BaseViewHolder> {
    /**
     * Same as QuickAdapter#QuickAdapter(Context,int) but with
     * some initialization data.
     *
     * @param data A new list is created out of this one to avoid mutable list
     */
    public RotationAdapter(List<MediaDetailBean> data) {
        super(data);
        //图片
        addItemType(1, R.layout.layout_image);
        //视频
        addItemType(2, R.layout.layout_video);
    }

    @Override
    protected void convert(BaseViewHolder helper, MediaDetailBean item) {
        switch (helper.getItemViewType()) {
            //图片
            case 1:
                ImageView imageView = helper.getView(R.id.img_view);
                Glide.with(MyApp.context).load(item.getUri()).into(imageView);
                break;
            //视频
            case 2:

                break;
        }
    }

//    @Override
//    public int getItemCount() {
//        return Integer.MAX_VALUE;
//    }
}
